﻿package mortal.game.net.command.shop
{
    import Framework.MQ.*;
    import Message.Game.*;
    import com.gengine.debug.*;
    import mortal.game.net.broadCast.*;

    public class BuyBackCommand extends BroadCastCall
    {

        public function BuyBackCommand(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function call(param1:MessageBlock) : void
        {
            Log.debug("I have receive BuyBackCommand");
            var _loc_2:* = param1.messageBase as SeqBuyBackItemMsg;
            var _loc_3:* = _loc_2.buyBackItems;
            _loc_3.sortOn("sellTime", this.sortArr);
            _cache.shop.buyBackList = _loc_3;
            return;
        }// end function

        private function sortArr(param1:Date, param2:Date) : int
        {
            if (param1.time > param2.time)
            {
                return -1;
            }
            return 1;
        }// end function

    }
}
